////////////////////////////////////////////////////////////////////////////////
// Filename: ModelsManager.h
////////////////////////////////////////////////////////////////////////////////
#ifndef _MODELSMANAGER_H_
#define _MODELSMANAGER_H_

#include <vector>
#include <map>
#include "ModelPosture.h"

class Model3D;
class ModelAnimation;
class ModelAnimationAdaptor;
class ModelPosture;
class ModelPostureLink;

class ModelsManager
{
public:
	ModelsManager();
	ModelsManager(const ModelsManager&);
	~ModelsManager();

	static ModelsManager* Instance();

	bool Initialize();
	void Uninit();

	Model3D* GetModel(int pId);

	ModelAnimation* GetModelAnimationByName(std::string pAnimationName);
	Model3D* GetModelByPath(std::string pModelPath);

	ModelPosture* GetPostureByName(std::string pPostureName);
	ModelPostureLink* GetModelPostureLink(std::string pPostureName, Model3D* pModel);
protected:
	static ModelsManager* mInstance;

	std::vector<Model3D*> mModels;
	std::map<int, Model3D*> mIdToModels;
	std::map<std::string, Model3D*> mPathToModels;

	std::vector<ModelAnimation*> mModelAnimations;
	std::map<int, ModelAnimation*> mIdToModelAnimations;
	std::map<std::string, ModelAnimation*> mNameToModelAnimations;

	std::vector<ModelAnimationAdaptor*> mModelAnimationAdaptors;

	std::vector<ModelPosture*> mModelPostures;
	std::map<std::string, ModelPosture*> mNameToModelPostures;
};

#endif